/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package boundless.managedbeans;

import javax.ejb.EJB;
import javax.inject.Named;
import javax.enterprise.context.Dependent;
import javax.inject.Inject;

import boundless.ejb.*;
import boundless.entities.*;
/**
 *
 * @author hendrikdekock
 */
@Named(value = "teamCreationBean")
@Dependent
public class TeamCreationBean {

    @EJB
    RequestBean rb;

    @Inject
    Account curUser;
    
    @Inject
    League curLeague;
    
    String error;
    /**
     * Creates a new instance of TeamCreationBean
     */
    public TeamCreationBean() {
    }
    
    public void setRequestBean(RequestBean rb) {
        this.rb = rb;
    }
    
    public void setCurUser(Account acc) {
        curUser = acc;
    }
    
    public void setCurLeague(League l) {
        curLeague = l;
    }
    
    public boolean createTeam(String name) {
        return rb.createTeam(curUser, curLeague, name);
    }
}
